package bairui.international.model.type;

/**
 *
 * (用户积分类型)Type_UserGrade
 */
@com.lianjing.sh.processing.info.annotation.GenerateInfoModel
@com.lianjing.sh.model.common.annotation.Comment("用户积分类型")
@com.lianjing.sh.processing.info.annotation.InfoComment("用户积分类型")
public enum Type_UserGrade implements com.sh_lianjing.standard.EnumCommentable<Type_UserGrade> {

	/**
	 * (系统赠送)OrderBuy</br>
	 */
	@com.lianjing.sh.model.common.annotation.Comment("系统赠送")
	@com.lianjing.sh.processing.info.annotation.InfoComment("系统赠送")
	OrderBuy("系统赠送")
,
	/**
	 * (商品兑换)Score</br>
	 */
	@com.lianjing.sh.model.common.annotation.Comment("商品兑换")
	@com.lianjing.sh.processing.info.annotation.InfoComment("商品兑换")
	Score("商品兑换")
;

	private static java.util.Map<String, Type_UserGrade> Cache = new java.util.HashMap<>();
	static{
		for(Type_UserGrade enumItem : Type_UserGrade.values()){
			Cache.put(enumItem.getComment(), enumItem);
		}
	}

	private String comment;

	private Type_UserGrade(String comment){
		this.comment = comment;
	}

	@Override
	public String toString() {
		return comment;
	}

	@Override
	public String getComment() {
		return comment;
	}

	@Override
	public Type_UserGrade parseByComment(String comment) {
		return Type_UserGrade.parse(comment);
	}

	public static Type_UserGrade parse(String comment) {
		Type_UserGrade enumItem = Cache.get(comment);
		if(null == enumItem){
			 throw new com.sh_lianjing.standard.exception.EnumCommentableException(Type_UserGrade.class, comment);
		}
		return enumItem;
	}

}
